home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / loftToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.8 KB  |  144 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  14 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      loftToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the loft command
  30. //
  31. //  Input Arguments:
  32. //        0 ==> do the command.
  33. //        1 ==> show the action option box
  34. //        2 ==> return the command
  35. //        3 ==> show tool option box
  36. //        4 ==> enter the tool
  37. //
  38. //  Return Value:
  39. //      None.
  40. //
  41.  
  42. global proc loftToolSetup( int $forceFactorySettings, string $goToTool )
  43. {
  44.     global int $gStartWithAutoComplete;
  45.     if( $forceFactorySettings || !`optionVar -ex loftEuc` ) {
  46.         optionVar -iv loftEuc 0;
  47.     }
  48.     if( $forceFactorySettings || !`optionVar -ex loftLac` ) {
  49.         optionVar -iv loftLac $gStartWithAutoComplete;
  50.     }
  51.     if( "" != $goToTool ) {
  52.         scriptCtx -e -euc `optionVar -q loftEuc` $goToTool;
  53.         scriptCtx -e -lac `optionVar -q loftLac` $goToTool;
  54.     }
  55. }
  56.  
  57. global proc loftValues ( string $toolName ) 
  58. {
  59.     performLoft 3 $toolName;
  60.     scriptCtxCommonValues( $toolName );
  61. }
  62.  
  63. global proc loftProperties()
  64. {
  65.     scriptCtxCommonProperties;
  66. }
  67.  
  68. proc createLoftContext( string $tool )
  69. {
  70.     if( ! `scriptCtx -exists $tool` ) {
  71.         loftToolSetup( 0, "" );
  72.         scriptCtx -i1 "skin.xpm"
  73.           -title "Loft Tool"
  74.           -bcn "loft"
  75.  
  76.           -totalSelectionSets 2
  77.  
  78.           -exitUponCompletion `optionVar -q loftEuc`
  79.           -expandSelectionList true
  80.           -forceAddSelect true
  81.           -fcs ("loftToolScript 0")
  82.  
  83.           -setNoSelectionPrompt ("Select curves to loft (or an " +
  84.                                  "existing lofted surface).  Ctrl select " +
  85.                                  "to start a new loft.")
  86.           -setSelectionPrompt ("Select additional curves or " +
  87.                                "press ENTER to compute loft.")
  88.  
  89.           -setAllowExcessCount false
  90.           -setAutoToggleSelection true
  91.           -setAutoComplete 1
  92.           -setSelectionCount 1
  93.  
  94.           -nurbsCurve true
  95.           -isoparm true
  96.           -curveOnSurface true
  97.           -surfaceEdge true
  98.           -polymeshEdge true
  99.           -nurbsSurface true
  100.  
  101.  
  102.           -setNoSelectionPrompt ("Select curves to loft.  " +
  103.                                  "Ctrl select " +
  104.                                  "to start a new loft.")
  105.           -setSelectionPrompt ("Select additional curves or " +
  106.                                "press ENTER to compute loft.")
  107.  
  108.           -setAllowExcessCount true
  109.           -setAutoToggleSelection true
  110.           -setAutoComplete `optionVar -q loftLac`
  111.           -setSelectionCount 0
  112.  
  113.           -nurbsCurve true
  114.           -isoparm true
  115.           -curveOnSurface true
  116.           -surfaceEdge true
  117.           -polymeshEdge true
  118.           -nurbsSurface true
  119.         $tool;
  120.     }
  121. }
  122.  
  123. global proc string loftToolScript( int $setToTool )
  124. //
  125. //    Description :
  126. //        0 ==> do the command.
  127. //        1 ==> show the action option box
  128. //        2 ==> return the command
  129. //        3 ==> show tool/action option box
  130. //        4 ==> enter the tool/do the action
  131. {
  132.     string $tool = "";
  133.     if( $setToTool > 2 ) {
  134.         if( !`optionVar -q modelWithToolLoft` ) {
  135.             $setToTool = 4 - $setToTool;
  136.         }
  137.         else {
  138.             $tool = "loftContext";
  139.             createLoftContext $tool;
  140.         }
  141.     }
  142.     return scriptToolScript( "performLoft", $setToTool, $tool );
  143. }
  144.